<template>
  <div v-show="formData[key].isshow">
    <el-form-item  :label="component.attrName" :id="key" :prop="key + '.value'" :required="formData[key].required.split(',').includes('empty')">
      <add-amount
        :infors="orderItemInfors"
        :formData="formData"
        :formKey="key"
        @getrow="getAccInfo"
        @getAccData="getAccData"
      ></add-amount>
    </el-form-item>
  </div>
</template>

<script>
import { mapState } from "vuex";
import addAmount from "./addAmount.vue";
export default {
  name: "ProvincAccount",
  components: {
      addAmount
  },
  data() {
    return {
      orderItemInfors: {
        custSoNumber: "", //页面初始化流水号,
        custId: "",
        custName: "",
        accepteRegionId: "",
        commonRegionId: "",
        createStaff: "",
        createOrgId: "",
        productId: JSON.parse(sessionStorage.getItem("ppmCondition")).prodId,
        attrId: "",
      },
    };
  },
    props: {
    component: {
      type: Object,
      default: () => {
        return {};
      },
    },
    formData: {
      type: Object,
    },
    ruleData: {
      type: Object,
    },
    actionValue: {
      type: String,
      default: "",
    },
    span: {
      type: Number || String,
      default: 16,
    },
    config: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  computed: {
    ...mapState("orders", ["orderPosInfo"]),
      key() {
      return this.component.pageTempStructId + "-" + this.component.attrId;
    },
  },
  mounted() {
    this.orderItemInfors.custId = this.orderPosInfo.custId; //客户id   传给订单项信息公共组件
    this.orderItemInfors.custName = this.orderPosInfo.custName; //客户名称   传给订单项信息公共组件
  },
  methods: {
   //选中省账户   
    getAccInfo(row) {
      // const {PROVINCE_ACCOUNT_ID} = row 
      // this.formData[this.key].value = PROVINCE_ACCOUNT_ID
      // this.formData[this.key].text = PROVINCE_ACCOUNT_ID
      this.$emit('getPluginValue',row)
    },
    getAccData(val) {
     
    },
  },
};
</script>

<style lang="scss" scoped>
</style>